        * {
            padding: 0;
            margin: 0;
            box-sizing: border-box;
            font-family: "Poppins", sans-serif;
        }

        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            overflow-x: hidden;
            position: relative;
        }

        .card {
            width: 640px;
            height: 400px;
            position: absolute;
            margin: auto;
            left: 0;
            right: 0;
            top: 0;
            bottom: 0;
            perspective: 1200px;
            transition: all 1s ease;
            z-index: 10;
        }

        .card:hover {
            transform: rotate(-5deg) scale(1.02);
        }

        .card:hover .outside {
            transform: rotateY(-130deg);
        }

        .outside, .inside {
            height: 100%;
            width: 50%;
            position: absolute;
            left: 50.1%;
            border-radius: 15px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.3);
        }

        .inside {
            background: linear-gradient(135deg, #ffeaa7, #fab1a0);
            padding: 15px;
            text-align: center;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            left: 50%;
            color: #2d3436;
            overflow: hidden;
        }

        .outside {
            transform-style: preserve-3d;
            z-index: 1;
            transform-origin: left;
            transition: 2s;
            cursor: pointer;
        }

        .front, .back {
            height: 100%;
            width: 100%;
            position: absolute;
            backface-visibility: hidden;
            border-radius: 15px;
        }

        .front {
            background: linear-gradient(135deg, #74b9ff, #0984e3);
            color: white;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .back {
            transform: rotateY(180deg);
            background: linear-gradient(135deg, #fd79a8, #e84393);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 20px;
            color: white;
            text-align: center;
        }

        .back .from-section {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 15px;
            text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
        }

        .back .names-list {
            font-size: 13px;
            line-height: 1.4;
            margin-bottom: 15px;
            font-weight: 400;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
        }

        .back .to-section {
            font-size: 18px;
            font-weight: 700;
            margin-bottom: 10px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .back .message {
            font-size: 14px;
            font-style: italic;
            font-weight: 300;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
        }

        .cake {
            width: 100%;
            position: relative;
            margin: 20px 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 200px;
        }

        .bottom-layer {
            height: 50px;
            width: 180px;
            background: linear-gradient(45deg, #8b4513, #d2691e);
            border-radius: 8px;
            position: absolute;
            bottom: 0;
            border: 3px solid #654321;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .middle-layer {
            height: 45px;
            width: 140px;
            background: linear-gradient(45deg, #ff69b4, #ff1493);
            border-radius: 8px;
            position: absolute;
            bottom: 45px;
            border: 3px solid #dc143c;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .top-layer {
            height: 40px;
            width: 100px;
            background: linear-gradient(45deg, #fdcb6e, #f39c12);
            border-radius: 8px;
            position: absolute;
            bottom: 85px;
            border: 3px solid #e67e22;
            box-shadow: 0 5px 15px rgba(0,0,0,0.3);
        }

        .candle {
            height: 35px;
            width: 8px;
            background: linear-gradient(45deg, #fd3018, #ffa89e);
            position: absolute;
            bottom: 125px;
            left: 50%;
            transform: translateX(-50%);
            border-radius: 2px;
            animation: sway 2s ease-in-out infinite alternate;
        }

        .candle:before {
            content: "";
            position: absolute;
            height: 12px;
            width: 12px;
            background: radial-gradient(circle, #ff6b35, #f7931e);
            border-radius: 50%;
            bottom: 35px;
            left: -2px;
            animation: flicker 1s ease-in-out infinite alternate;
        }

        @keyframes sway {
            0% { transform: rotate(-2deg); }
            100% { transform: rotate(2deg); }
        }

        @keyframes flicker {
            0% { transform: scale(1) rotate(-5deg); }
            100% { transform: scale(1.2) rotate(5deg); }
        }

        .outside p {
            font-size: 28px;
            font-weight: 600;
            margin-top: 30px;
            text-align: center;
            letter-spacing: 3px;
            color: white;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
        }

        .inside h1 {
            font-size: 60px;
            line-height: 60px;
            animation: bounce 2s ease-in-out infinite;
            margin: 10px 0;
        }

        .inside p {
            font-size: 14px;
            line-height: 1.4;
            font-weight: 400;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
            margin: 5px 0;
        }

        .inside p:first-child {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .inside p:last-child {
            font-size: 12px;
            font-style: italic;
            margin-top: 8px;
        }

        @keyframes bounce {
            0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
            40% { transform: translateY(-10px); }
            60% { transform: translateY(-5px); }
        }

        /* Fireworks Button */
        .celebration-btn {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            padding: 15px 30px;
            background: linear-gradient(45deg, #ff6b6b, #feca57);
            border: none;
            border-radius: 50px;
            color: white;
            font-size: 18px;
            font-weight: 600;
            cursor: pointer;
            box-shadow: 0 10px 25px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
            z-index: 100;
            text-transform: uppercase;
            letter-spacing: 2px;
        }

        .celebration-btn:hover {
            transform: translateX(-50%) translateY(-5px);
            box-shadow: 0 15px 35px rgba(0,0,0,0.4);
        }

        .celebration-btn:active {
            transform: translateX(-50%) translateY(-2px);
        }

        /* Balloons */
        .balloon {
            position: absolute;
            width: 60px;
            height: 80px;
            border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
            animation: float 3s ease-in-out infinite;
            opacity: 0;
            transition: opacity 0.5s ease;
        }

        .balloon::after {
            content: '';
            position: absolute;
            width: 2px;
            height: 60px;
            background: #333;
            left: 50%;
            bottom: -60px;
            transform: translateX(-50%);
        }

        .balloon.red { background: linear-gradient(45deg, #ff6b6b, #ee5a52); }
        .balloon.blue { background: linear-gradient(45deg, #74b9ff, #0984e3); }
        .balloon.yellow { background: linear-gradient(45deg, #fdcb6e, #e17055); }
        .balloon.green { background: linear-gradient(45deg, #55a3ff, #1e3c72); }
        .balloon.purple { background: linear-gradient(45deg, #fd79a8, #e84393); }

        @keyframes float {
            0%, 100% { transform: translateY(0) rotate(-3deg); }
            50% { transform: translateY(-20px) rotate(3deg); }
        }

        /* Fireworks */
        .firework {
            position: absolute;
            width: 6px;
            height: 6px;
            border-radius: 50%;
            opacity: 0;
        }

        .firework.explode {
            animation: explode 1s ease-out forwards;
        }

        @keyframes explode {
            0% {
                opacity: 1;
                transform: scale(0);
            }
            100% {
                opacity: 0;
                transform: scale(20);
            }
        }

        /* Happy Birthday Text Animation */
        .birthday-text {
            position: fixed;
            top: 10%;
            left: 50%;
            transform: translateX(-50%);
            font-size: 60px;
            font-weight: 700;
            color: #fff;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
            opacity: 0;
            z-index: 50;
            text-align: center;
            pointer-events: none;
        }

        .birthday-text.show {
            animation: birthdayTextShow 3s ease-in-out forwards;
        }

        @keyframes birthdayTextShow {
            0% { opacity: 0; transform: translateX(-50%) scale(0.5); }
            50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
            100% { opacity: 1; transform: translateX(-50%) scale(1); }
        }

        .birthday-text.hide {
            animation: birthdayTextHide 0.5s ease-in-out forwards;
        }

        @keyframes birthdayTextHide {
            0% { opacity: 1; transform: translateX(-50%) scale(1); }
            100% { opacity: 0; transform: translateX(-50%) scale(0.5); }
        }

        /* Music note animation */
        .music-note {
            position: absolute;
            font-size: 30px;
            opacity: 0;
            animation: musicFloat 2s ease-in-out infinite;
        }

        @keyframes musicFloat {
            0% { opacity: 0; transform: translateY(0); }
            50% { opacity: 1; transform: translateY(-30px); }
            100% { opacity: 0; transform: translateY(-60px); }
        }

        /* ===== RESPONSIVE DESIGN ===== */

        /* Large Tablets and Small Desktops (768px - 1024px) */
        @media screen and (max-width: 1024px) {
            .card {
                width: 560px;
                height: 350px;
            }

            .outside p {
                font-size: 24px;
                letter-spacing: 2px;
            }

            .inside h1 {
                font-size: 70px;
                line-height: 70px;
            }

            .inside p {
                font-size: 16px;
            }

            .birthday-text {
                font-size: 50px;
            }

            .celebration-btn {
                font-size: 16px;
                padding: 12px 25px;
            }
        }

        /* Tablets (600px - 768px) */
        @media screen and (max-width: 768px) {
            .card {
                width: 480px;
                height: 300px;
            }

            .outside p {
                font-size: 20px;
                letter-spacing: 1px;
                margin-top: 20px;
            }

            .inside {
                padding: 15px;
            }

            .inside h1 {
                font-size: 60px;
                line-height: 60px;
            }

            .inside p {
                font-size: 14px;
                line-height: 1.4;
            }

            .back .from-section {
                font-size: 14px;
                margin-bottom: 12px;
            }

            .back .names-list {
                font-size: 11px;
                line-height: 1.3;
                margin-bottom: 12px;
            }

            .back .to-section {
                font-size: 16px;
                margin-bottom: 8px;
            }

            .back .message {
                font-size: 12px;
            }

            .cake {
                height: 160px;
                margin: 15px 0;
            }

            .bottom-layer {
                height: 40px;
                width: 140px;
            }

            .middle-layer {
                height: 35px;
                width: 110px;
                bottom: 35px;
            }

            .top-layer {
                height: 30px;
                width: 80px;
                bottom: 65px;
            }

            .candle {
                height: 25px;
                width: 6px;
                bottom: 95px;
            }

            .candle:before {
                height: 10px;
                width: 10px;
                bottom: 25px;
            }

            .birthday-text {
                font-size: 40px;
                top: 8%;
            }

            .celebration-btn {
                font-size: 14px;
                padding: 10px 20px;
                bottom: 20px;
            }

            .balloon {
                width: 50px;
                height: 65px;
            }

            .music-note {
                font-size: 25px;
            }
        }

        /* Large Mobile Phones (480px - 600px) */
        @media screen and (max-width: 600px) {
            .card {
                width: 90vw;
                max-width: 400px;
                height: 280px;
            }

            .outside p {
                font-size: 18px;
                letter-spacing: 1px;
                margin-top: 15px;
            }

            .inside {
                padding: 12px;
            }

            .inside h1 {
                font-size: 45px;
                line-height: 45px;
            }

            .inside p {
                font-size: 12px;
                line-height: 1.3;
            }

            .inside p:first-child {
                font-size: 14px;
            }

            .inside p:last-child {
                font-size: 10px;
            }

            .back {
                padding: 15px;
            }

            .back .from-section {
                font-size: 12px;
                margin-bottom: 10px;
            }

            .back .names-list {
                font-size: 10px;
                line-height: 1.2;
                margin-bottom: 10px;
            }

            .back .to-section {
                font-size: 14px;
                margin-bottom: 6px;
            }

            .back .message {
                font-size: 10px;
            }

            .cake {
                height: 140px;
                margin: 10px 0;
            }

            .bottom-layer {
                height: 35px;
                width: 120px;
            }

            .middle-layer {
                height: 30px;
                width: 95px;
                bottom: 30px;
            }

            .top-layer {
                height: 25px;
                width: 70px;
                bottom: 55px;
            }

            .candle {
                height: 20px;
                width: 5px;
                bottom: 80px;
            }

            .candle:before {
                height: 8px;
                width: 8px;
                bottom: 20px;
                left: -1.5px;
            }

            .birthday-text {
                font-size: 32px;
                top: 5%;
                padding: 0 10px;
            }

            .celebration-btn {
                font-size: 13px;
                padding: 8px 16px;
                bottom: 15px;
                letter-spacing: 1px;
            }

            .balloon {
                width: 40px;
                height: 55px;
            }

            .balloon::after {
                height: 45px;
                width: 1.5px;
            }
        }

        /* Small Mobile Phones (320px - 480px) */
        @media screen and (max-width: 480px) {
            .card {
                width: 95vw;
                max-width: 340px;
                height: 250px;
            }

            .outside p {
                font-size: 16px;
                letter-spacing: 0.5px;
                margin-top: 12px;
                line-height: 1.2;
            }

            .inside {
                padding: 10px;
            }

            .inside h1 {
                font-size: 35px;
                line-height: 35px;
            }

            .inside p {
                font-size: 11px;
                line-height: 1.2;
            }

            .inside p:first-child {
                font-size: 12px;
            }

            .inside p:last-child {
                font-size: 9px;
            }

            .back {
                padding: 12px;
            }

            .back .from-section {
                font-size: 11px;
                margin-bottom: 8px;
            }

            .back .names-list {
                font-size: 9px;
                line-height: 1.1;
                margin-bottom: 8px;
            }

            .back .to-section {
                font-size: 12px;
                margin-bottom: 5px;
            }

            .back .message {
                font-size: 9px;
            }

            .cake {
                height: 120px;
                margin: 8px 0;
            }

            .bottom-layer {
                height: 30px;
                width: 100px;
                border-width: 2px;
            }

            .middle-layer {
                height: 25px;
                width: 80px;
                bottom: 25px;
                border-width: 2px;
            }

            .top-layer {
                height: 20px;
                width: 60px;
                bottom: 45px;
                border-width: 2px;
            }

            .candle {
                height: 18px;
                width: 4px;
                bottom: 65px;
            }

            .candle:before {
                height: 7px;
                width: 7px;
                bottom: 18px;
                left: -1.5px;
            }

            .birthday-text {
                font-size: 24px;
                top: 3%;
                padding: 0 5px;
                line-height: 1.1;
            }

            .celebration-btn {
                font-size: 12px;
                padding: 6px 12px;
                bottom: 10px;
                letter-spacing: 0.5px;
            }

            .balloon {
                width: 35px;
                height: 45px;
            }

            .balloon::after {
                height: 35px;
                width: 1px;
            }

            .music-note {
                font-size: 20px;
            }
        }

        /* Extra Small Devices (max-width: 320px) */
        @media screen and (max-width: 320px) {
            .card {
                width: 98vw;
                max-width: 300px;
                height: 220px;
            }

            .outside p {
                font-size: 14px;
                letter-spacing: 0px;
                margin-top: 10px;
            }

            .inside {
                padding: 8px;
            }

            .inside h1 {
                font-size: 30px;
                line-height: 30px;
            }

            .inside p {
                font-size: 10px;
                line-height: 1.1;
            }

            .inside p:first-child {
                font-size: 11px;
            }

            .inside p:last-child {
                font-size: 8px;
            }

            .back {
                padding: 10px;
            }

            .back .from-section {
                font-size: 10px;
                margin-bottom: 6px;
            }

            .back .names-list {
                font-size: 8px;
                line-height: 1.0;
                margin-bottom: 6px;
            }

            .back .to-section {
                font-size: 11px;
                margin-bottom: 4px;
            }

            .back .message {
                font-size: 8px;
            }

            .cake {
                height: 100px;
                margin: 5px 0;
            }

            .bottom-layer {
                height: 25px;
                width: 85px;
            }

            .middle-layer {
                height: 20px;
                width: 68px;
                bottom: 20px;
            }

            .top-layer {
                height: 18px;
                width: 50px;
                bottom: 35px;
            }

            .candle {
                height: 15px;
                width: 3px;
                bottom: 53px;
            }

            .candle:before {
                height: 6px;
                width: 6px;
                bottom: 15px;
                left: -1.5px;
            }

            .birthday-text {
                font-size: 20px;
                top: 2%;
                padding: 0 3px;
            }

            .celebration-btn {
                font-size: 11px;
                padding: 5px 10px;
                bottom: 8px;
            }

            .balloon {
                width: 30px;
                height: 40px;
            }

            .firework {
                width: 4px;
                height: 4px;
            }
        }

        /* Landscape Orientation for Mobile */
        @media screen and (max-height: 500px) and (orientation: landscape) {
            .card {
                height: 200px;
                width: 400px;
            }

            .birthday-text {
                font-size: 28px;
                top: 5%;
            }

            .celebration-btn {
                bottom: 5px;
                font-size: 12px;
                padding: 5px 12px;
            }

            .cake {
                height: 100px;
            }

            .bottom-layer { height: 25px; width: 100px; }
            .middle-layer { height: 20px; width: 80px; bottom: 20px; }
            .top-layer { height: 18px; width: 60px; bottom: 35px; }
            .candle { height: 15px; bottom: 53px; }
        }

        /* High DPI Displays */
        @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
            .firework {
                width: 8px;
                height: 8px;
            }

            .balloon::after {
                width: 3px;
            }
        }

        /* Hover effects only for non-touch devices */
        @media (hover: hover) and (pointer: fine) {
            .card:hover {
                transform: rotate(-5deg) scale(1.02);
            }

            .celebration-btn:hover {
                transform: translateX(-50%) translateY(-5px);
                box-shadow: 0 15px 35px rgba(0,0,0,0.4);
            }
        }

        /* Touch devices - remove hover effects and adjust interactions */
        @media (hover: none) and (pointer: coarse) {
            .card:hover {
                transform: none;
            }

            .card:active {
                transform: rotate(-2deg) scale(1.05);
                transition: transform 0.1s ease;
            }

            .celebration-btn:hover {
                transform: translateX(-50%);
                box-shadow: 0 10px 25px rgba(0,0,0,0.3);
            }

            .celebration-btn:active {
                transform: translateX(-50%) scale(0.95);
            }
        }
